<template>
  <div>
    <div style="width: 864px;height: 564px;border: 1px solid #f00" id="container2"></div>
  </div>
</template>    

 
<script>
import * as echarts from 'echarts'
import changzhhou from './map.js'
import listDaty from './listDaty.js'
export default {
  data () {
    return {
    }
  },
  mounted () {
    this.init()
  },
  methods: {
    init () {
        let mCharts = echarts.init(document.getElementById('container2'))
        echarts.registerMap('xinbei', listDaty);
        var option = {
        geo: {
          type: 'map',
          map: 'xinbei', // chinaMap需要和registerMap中的第一个参数保持一致
          roam: true, // 设置允许缩放以及拖动的效果
          label: {
            show: true // 展示标签
          },
          zoom: 1, // 设置初始化的缩放比例
          center: [ 119.84443419453461, 31.821371669196193] // 设置地图中心点的坐标
        }
      }
      mCharts.setOption(option)
    }
}
 
}
</script>
 
